import 'dart:io';

import 'package:kmxy_base/base/base_package.dart';
import 'package:kmxy_base_example/page/page_manage_package.dart';
import 'main_page_state.dart';

class MainPageView extends MainPageState {
  @override
  Widget setPageContent(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("主界面"),
      ),
      body: Container(
        alignment: Alignment.center,
        child: Wrap(
          children: [
            TextButton(onPressed: list, child: const Text("列表案例")),
            TextButton(onPressed: network, child: const Text("网络请求案例")),
            TextButton(
                onPressed: oneDialog, child: const Text("一个按钮的dialog案例")),
            TextButton(
                onPressed: twoDialog, child: const Text("两个个按钮的dialog案例")),
            TextButton(onPressed: getPath, child: const Text("获取APP免权限路径")),
            TextButton(onPressed: permission, child: const Text("权限测试")),
            TextButton(
                onPressed: patrolPermission, child: const Text("巡查权限获取")),
            TextButton(onPressed: dateTime, child: const Text("日期时间选择器")),
            TextButton(onPressed: date, child: const Text("日期选择器")),
            TextButton(
                onPressed: cameraAndGallery, child: const Text("拍照，相册，视频")),
            TextButton(onPressed: map, child: const Text("高德地图")),
            TextButton(onPressed: startMic, child: const Text("开始录音")),
            TextButton(onPressed: endMic, child: const Text("停止录音")),
            TextButton(onPressed: startPlay, child: const Text("播放")),
            TextButton(onPressed: endPlay, child: const Text("停止")),
            TextButton(onPressed: camera, child: const Text("小米特制相机")),
            TextButton(
                onPressed: () => push(context, TablePage()),
                child: const Text("表格测试")),
            imageFile == null ? Container() : Image.file(File(imageFile ?? '')),
            TextButton(onPressed: webview, child: const Text("webview")),
            TextButton(onPressed: pdf, child: const Text("加载pdf")),
            TextButton(onPressed: form, child: const Text("表单案例")),
            TextButton(
                onPressed: amapLocation, child: const Text("高德地图后台定位案例")),
            TextButton(onPressed: callPhone, child: const Text("打电话")),
            TextButton(onPressed: locationData, child: const Text("高德地图定位数据")),
            TextButton(onPressed: selectCheck, child: const Text("多选界面")),
            TextButton(
                onPressed: requestIgnoreBatteryOptimizationsCheck,
                child: const Text("申请忽略电池优化")),
            TextButton(
                onPressed: aMapLatLngListTest, child: const Text("猎鹰轨迹测试")),
            TextButton(onPressed: signature, child: const Text("签名")),
            TextButton(onPressed: gps, child: const Text("gps是否开启")),
            TextButton(onPressed: getpath, child: const Text("路径获取")),
            TextButton(onPressed: setting, child: const Text("设置页面")),
            TextButton(onPressed: mapPickerMore, child: const Text("多级选择器")),
          ],
        ),
      ),
    );
  }
}
